<template>
    <div class="">
        <el-dialog width="1000px" title="中奖纪录" :visible.sync="state" :show-close="true" :close-on-click-modal="false">
        <div>
            <!-- 表格信息　　开始 -->
            <vue-table
                :api-url="table.apiUrl"
                :fields="table.fields"
                :appendParams="table.queryParams"
                :content="self"
                ref="dictionaryTable">
            </vue-table>
            <!-- 表格信息　　结束 -->
        </div>
            <div slot="footer" class="dialog-footer">
                <!-- <el-button type="primary" size="small" @click="">确 定</el-button> -->
                <el-button @click="state = false"  size="small">关 闭</el-button>
            </div>
        </el-dialog>
    </div>
</template>

<script>
    import {enums} from '@/constant'
    import moment from 'moment'
    export default {
        data() {

            return {
                state: false,
                self:this,
				table: {
                    apiUrl: api.userManagement.wainningInfo,
                    queryParams: {
                        username:''
                    },
                    fields: [{
                            prop: "__index",
                            width: "60",
                            label: "序号",
                        },
                        {
                            prop: "created",
                            label: "时间",
                            formatter : function(row, column, cellValue){                                
                                if(cellValue){
                                    if(cellValue){
                                        return moment(cellValue).format('YYYY-MM-DD')
                                    }
                                }
                            }
                        },
                        {
                            prop: "description",
                            label: "详情",
                        },
                        {
                            prop: "__action",
                            label: "操作",
                            width:100,
                            actions: [

                                {
                                    label: "删除",
                                    type: "delete",
                                    func: function(vm, row) {
                                       vm.deleteWinningInfo(row.id);
                                    }
                                },
                            ]
                        }
                    ]
                }
            }
        },
        created() {

        },
        mounted() {},
        methods: {
            showDialog(val){
                this.username = val;
                this.table.queryParams.username = val.login;
                // this.table.queryParams.username = 18363016352;
                this.state = true;
            },
            deleteWinningInfo(){
                
            },
            
        },


    };
</script>
<style scoped>
</style>